package com.wlz.security.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.UserDetailsService;

/**
 *  方式2 基于UserDetailsService接口 noop 密码加密
 */
//@Configuration
//@EnableWebSecurity 基于springboot 可以不用
public class WebSecurityConfig1 extends WebSecurityConfigurerAdapter {


    @Autowired
    private UserDetailsService myUserDetailsService1;

    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.userDetailsService(myUserDetailsService1);
    }



}
